var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.open("POST", "ajax_test.asp", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("fname=Bill&lname=Gates");

xmlhttp.onreadystatechange = function() {
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
	}
}
xmlhttp.open("GET", "test1.txt", true);
xmlhttp.send();

document.getElementById("myDiv").innerHTML = xmlhttp.responseText;

xmlhttp.onreadystatechange = function() {
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
	}
}

function myFunction() {
	loadXMLDoc("ajax_info.txt", function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
		}
	});
}


var JL={};
JL.SimpleXhrFactory=(
	var standard={
		createXhrObject:function(){
			return new XMLHttpRequest();
		}
	};
	var activeXNew={
			createXhrObject:function(){
				return new ActiveXObject('Msxml2.XMLHTTP');
			}
		};
	var activeXOld={
			createXhrObject:function(){
				return new ActiveXObject('Microsoft.XMLHTTP');
			}
		};
	var testObject;
	try{
		testObject=standard.createXhrObject();
		return standard;
	}catch(e){
		try{
			testObject=activeXNew.createXhrObject();
			return activeXNew;
		}catch(e){
			try{
				testObject=activeXOld.createXhrObject();
				return activeXOld;
			}catch(e){
				throw new Error('No XHR object found in this environment.');
			}
		}
	}
)();
JL.AJAX=(function(){
	var uniqueInstance;
	function constructor(){
		var data="";
		var type="";
		var enctype="";
		var reRenderId="";
		function beforeSend(){
        }
        function error(request) {      
            alert("表单提交出错，请稍候再试");
        }
        function success(data) {
        	$("#content").html(data);
        }
	}
	return {
		getInstance:function(){
			if(!uniqueInstance){
				uniqueInstance=constructor();
			}
			return uniqueInstance
		}
	}
})();


 
 
 
  